name: CI

on:
  pull_request:
    branches:
      - master
  push:
    branches:
      - master

jobs:
  build:
    strategy:
      matrix:
        include:
            - java: '8'
              maven-profiles: '-P osgi-tests,kotlin'
            - java: '11'
              maven-profiles: ''
            - java: '17'
              maven-profiles: '-P modern-jvm'
            - java: '21'
              maven-profiles: '-P modern-jvm'

    runs-on: 'ubuntu-latest'
    steps:
    - uses: actions/checkout@main
    - name: Set up JDK
      uses: actions/setup-java@main
      with:
        java-version: ${{ matrix.java }}
        distribution: 'zulu'
        cache: 'maven'
    - name: Build
      run: mvn --no-transfer-progress -B clean install ${{ matrix.maven-profiles }}
